﻿//=====================================================================================================
// LocalizationLibrary
// The Localization Library is a collection of reusable software components that provide 
// support for localization. This library enables you to localize WPF, Silverlight and WP7 applications.
// (http://localizationlibrary.codeplex.com)
//=====================================================================================================
// Author: Nicola Gallo (Website: www.nicola.gallo.name, Email: nicolagmt@hotmail.it) 
//=====================================================================================================

namespace HelloWorld.Startup.ViewModels
{
    //.NET References
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.Composition;
    using System.Linq;
    using System.Text;

    // Microsoft References
    using Microsoft.Practices.Composite.Presentation.Commands;

    //HelloWorld References
    using HelloWorld.Startup.MVVM;
    using HelloWorld.Startup.Views;

    /// <summary>
    /// Defines the menu's <see cref="ViewModel"/>.
    /// </summary>
    [Export("MenuComposition", typeof(IViewModel))]
    public class MenuVM : ViewModel
    {
        //Constructors

        /// <summary>
        /// Default constructor.
        /// </summary>
        public MenuVM()
        {
            this.OpenLMDynamicLocalizationCommand = 
                new DelegateCommand<object>(this.OpenLMDynamicLocalization);
            this.OpenLMStaticLocalizationCommand =
                new DelegateCommand<object>(this.OpenLMStaticLocalization);
            this.OpenPMDynamicLocalizationCommand =
                new DelegateCommand<object>(this.OpenPMDynamicLocalization);
            this.OpenPMStaticLocalizationCommand =
                new DelegateCommand<object>(this.OpenPMStaticLocalization);
        }

        //Properties

        public DelegateCommand<Object> OpenLMDynamicLocalizationCommand { get; private set; }
        public DelegateCommand<Object> OpenLMStaticLocalizationCommand { get; private set; }
        public DelegateCommand<Object> OpenPMDynamicLocalizationCommand { get; private set; }
        public DelegateCommand<Object> OpenPMStaticLocalizationCommand { get; private set; }

        //Methods

        public void OpenLMDynamicLocalization(Object instance)  
        {
            ApplicationManager.SetCurrentView<LMDynamicLocalizationView>();
        }
        
        public void OpenLMStaticLocalization(Object instance) 
        {
            ApplicationManager.SetCurrentView<LMStaticLocalizationView>();
        }

        public void OpenPMDynamicLocalization(Object instance) 
        {
            ApplicationManager.SetCurrentView<VMDynamicLocalizationView>();
        }

        public void OpenPMStaticLocalization(Object instance) 
        {
            ApplicationManager.SetCurrentView<VMStaticLocalizationView>();
        } 
    }
}
